/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import Database.*;
import Parser.BibtexDirectory;
import Parser.BibtexFile;

import java.util.*;

/**
 * 
 * @author cod
 */

public class Main
{
	public static void main(String[] args)
	{
		
		// creare conexiuni catre ambele bd
		OracleConnection.getOracleConnection1();
		OracleConnection.getOracleConnection2();

		/*
		 * model definire autor (nume, date contact) --"-- carte (titlu,
		 * editura) --"-- articol (titlu, publicatie)
		 */
		/*
		Author a = new Author("gigi3", "014151");
		Book b = new Book("carte", "aafafa");
		Article c = new Article("articol1", "aaa");

		// inserare carte b scrisa de autor a
		OracleConnection.insertIntoDB1(a, b);

		// inserare articol c scris de autor a
		OracleConnection.insertIntoDB2(a, c);

		// selectie informatii pentru autorul 'gigi2';

		// primul param este autor al doilea este tipul selectie:
		// 1 - doar carti, 2 - doar articole, 3 - articole + carti
		SolutionForView sol = OracleConnection.selectResult("gigi2", 3);

		// afisare doar pt carti
		Iterator<String> it1 = sol.getColabsBooks().iterator();
		Iterator<Integer> it2 = sol.getPcommBooks().iterator();
		while (it1.hasNext())
		{
			System.out.println(it1.next() + " \t " + it2.next());
		}

		// afisare doar pt articole
		Iterator<String> it3 = sol.getColabsArticles().iterator();
		Iterator<Integer> it4 = sol.getPcommArticles().iterator();
		while (it3.hasNext())
		{
			System.out.println(it3.next() + " \t " + it4.next());
		}

		System.out.println("\n\n\n");
		// afisare pt articole + carti
		Iterator<String> it5 = sol.getCombined().iterator();
		Iterator<Integer> it6 = sol.getpCombined().iterator();
		while (it5.hasNext())
		{
			System.out.println(it5.next() + " \t " + it6.next());
		}

		// inchidere conexiuni
		OracleConnection.closeConnections();

		System.out.println("Goodbye!");
		*/
		
		
		
		
		
	}
}
